//
//  DTBizUtil.m
//  PersonalManager
//
//  Created by user on 16/8/16.
//  Created by user on 16/8/15.
//  Copyright © 2016年 Haiyun.Qian. All rights reserved.
//

#import "DTBizUtil.h"

@implementation DTBizUtil

//加密
-(void)encrypt:(DTJavascriptCommand *)command {
    
    _dic = [[NSDictionary alloc]init];
    
    self.dic  = [command getParamValue:@"data"];
    NSString *string1 = [_dic objectForKey:@"h"];
    NSString *string2 = [_dic objectForKey:@"w"];
    _dic = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%@zzz",string1],@"h",[NSString stringWithFormat:@"%@zzz",string2],@"w", nil];

    [command successRessponse:_dic];
}

//解密
-(void)decrypt:(DTJavascriptCommand *)command {
    self.dic  = [command getParamValue:@"data"];
    NSString *string1 = [_dic objectForKey:@"h"];
    NSString *string2 = [_dic objectForKey:@"w"];
    _dic = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%@zzz",string1],@"h",[NSString stringWithFormat:@"%@zzz",string2],@"w", nil];
    
    [command successRessponse:_dic];
}

/** 扫码 */
- (void) scan:(DTJavascriptCommand *)command{
    self.action = [[DTBizUtilAction alloc] initWithCommand:command];
    command.actionObject = self.action;
    [self.action scan];
}

@end
